home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Text / Inline Input for TextEdit / InlineInputSample / InlineInputSample.r < prev    next >
Encoding:
Text File  |  1994-02-15  |  7.8 KB  |  396 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        InlineInputSample.r
  3.  
  4.     Contains:    Resource definitions for InlineInputSample
  5.  
  6.     Copyright:    © 1989-1994 Apple Computer, Inc. All rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #if qInline
  12. #define qAppleEvents 1
  13. #endif
  14.  
  15.  
  16. #define SystemSevenOrLater 1
  17.  
  18. #include "SysTypes.r"
  19. #include "Types.r"
  20. #include "CodeFragmentTypes.r"
  21.  
  22. #include "InlineInputSample.h"
  23.  
  24.  
  25. // application signature and name
  26.  
  27. #define kSignature 'issa'
  28. #if qAppleEvents
  29. #if qInline
  30. #define kApplicationName "InlineInputSample"
  31. #define kApplicationBlurb "Styled TextEdit Application with Inline Input"
  32. #else // qInline
  33. #define kApplicationName "AppleEventsSample"
  34. #define kApplicationBlurb "Styled TextEdit Application with Apple Events"
  35. #endif // qInline
  36. #else // qAppleEvents
  37. #define kApplicationName "SimpleSample"
  38. #define kApplicationBlurb "Styled TextEdit Application"
  39. #endif // qAppleEvents
  40.  
  41. // constant for disabling all items in a menu
  42.  
  43. #define allDisabled 0
  44.  
  45.  
  46. resource 'vers' (1) {
  47.     0x01, 0x01, release, 0x00, verUS,
  48.     "1.0.1",
  49.     "1.0.1, (c) 1989-1994 Apple Computer, Inc."
  50. };
  51.  
  52.  
  53. // we use an MBAR resource to conveniently load all the menus
  54.  
  55. resource 'MBAR' (rMenuBar, preload) {
  56.     { mApple, mFile, mEdit, mFont, mFontSize, mStyle };
  57. };
  58.  
  59.  
  60. resource 'MENU' (mApple, preload) {
  61.     mApple, textMenuProc,
  62.     allEnabled,
  63.     enabled, apple,
  64.     {
  65.         "About " kApplicationName "...",
  66.             noicon, nokey, nomark, plain;
  67.         "-",
  68.             noicon, nokey, nomark, plain
  69.     }
  70. };
  71.  
  72. resource 'MENU' (mFile, preload) {
  73.     mFile, textMenuProc,
  74.     allDisabled,
  75.     enabled, "File",
  76.     {
  77.         "New",
  78.             noicon, "N", nomark, plain;
  79.         "Open...",
  80.             noicon, "O", nomark, plain;
  81.         "-",
  82.             noicon, nokey, nomark, plain;
  83.         "Close",
  84.             noicon, "W", nomark, plain;
  85.         "Save",
  86.             noicon, "S", nomark, plain;
  87.         "-",
  88.             noicon, nokey, nomark, plain;
  89.         "Page Setup...",
  90.             noicon, nokey, nomark, plain;
  91.         "Print...",
  92.             noicon, nokey, nomark, plain;
  93.         "-",
  94.             noicon, nokey, nomark, plain;
  95.         "Quit",
  96.             noicon, "Q", nomark, plain
  97.     }
  98. };
  99.  
  100. resource 'MENU' (mEdit, preload) {
  101.     mEdit, textMenuProc,
  102.     allDisabled,
  103.     enabled, "Edit",
  104.      {
  105.         "Undo",
  106.             noicon, "Z", nomark, plain;
  107.         "-",
  108.             noicon, nokey, nomark, plain;
  109.         "Cut",
  110.             noicon, "X", nomark, plain;
  111.         "Copy",
  112.             noicon, "C", nomark, plain;
  113.         "Paste",
  114.             noicon, "V", nomark, plain;
  115.         "Clear",
  116.             noicon, nokey, nomark, plain;
  117.         "-",
  118.             noicon, nokey, nomark, plain;
  119.         "Select All",
  120.             noicon, "A", nomark, plain
  121.     }
  122. };
  123.  
  124. resource 'MENU' (mFont, preload) {
  125.     mFont, textMenuProc,
  126.     allEnabled,
  127.     enabled, "Font",
  128.      {
  129.      }
  130. };
  131.  
  132. resource 'MENU' (mFontSize, preload) {
  133.     mFontSize, textMenuProc,
  134.     allEnabled,
  135.     enabled, "Size",
  136.      {
  137.          "9 Point", noIcon, noKey, noMark, plain,
  138.         "10 Point", noIcon, noKey, noMark, plain,
  139.         "12 Point", noIcon, noKey, noMark, plain,
  140.         "14 Point", noIcon, noKey, noMark, plain,
  141.         "18 Point", noIcon, noKey, noMark, plain,
  142.         "24 Point", noIcon, noKey, noMark, plain
  143.      }
  144. };
  145.  
  146. resource 'MENU' (mStyle, preload) {
  147.     mStyle, textMenuProc,
  148.     allEnabled,
  149.     enabled, "Style",
  150.      {
  151.         "Plain",
  152.             noicon, "P", nomark, plain;
  153.         "-",
  154.             noicon, nokey, nomark, plain;
  155.         "Bold",
  156.             noicon, "B", nomark, bold;
  157.         "Italic",
  158.             noicon, "I", nomark, italic;
  159.         "Underline",
  160.             noicon, "U", nomark, underline;
  161.         "Outline",
  162.             noicon, nokey, nomark, outline;
  163.         "Shadow",
  164.             noicon, nokey, nomark, shadow
  165.     }
  166. };
  167.  
  168.  
  169. /* this ALRT and DITL are used as an About screen */
  170.  
  171. resource 'ALRT' (rAboutAlert, purgeable) {
  172.     {40, 20, 210, 340},
  173.     rAboutAlert,
  174.     {    OK, visible, silent,
  175.         OK, visible, silent,
  176.         OK, visible, silent,
  177.         OK, visible, silent
  178.     },
  179.     alertPositionMainScreen
  180. };
  181.  
  182. resource 'DITL' (rAboutAlert, purgeable) {
  183.     {    /* array DITLarray: 5 elements */
  184.         /* [1] */
  185.         {140, 230, 160, 310},
  186.         Button {
  187.             enabled,
  188.             "OK"
  189.         },
  190.         /* [2] */
  191.         {10, 10, 26, 329},
  192.         StaticText {
  193.             disabled,
  194.             kApplicationBlurb
  195.         },
  196.         /* [3] */
  197.         {30, 10, 62, 336},
  198.         StaticText {
  199.             disabled,
  200.             "(c) 1989-1994 Apple Computer, Inc. \n"
  201.             "All rights reserved."
  202.         },
  203.         /* [4] */
  204.         {70, 10, 86, 139},
  205.         StaticText {
  206.             disabled,
  207.             "Brought to you by:"
  208.         },
  209.         /* [5] */
  210.         {90, 30, 122, 299},
  211.         StaticText {
  212.             disabled,
  213.             "Developer Support Center &\n"
  214.             "International Software Support"
  215.         }
  216.     }
  217. };
  218.  
  219.  
  220. /* this ALRT and DITL are used as an error screen */
  221.  
  222. resource 'ALRT' (rUserAlert, purgeable) {
  223.     {40, 20, 150, 260},
  224.     rUserAlert,
  225.     { /* array: 4 elements */
  226.         /* [1] */
  227.         OK, visible, silent,
  228.         /* [2] */
  229.         OK, visible, silent,
  230.         /* [3] */
  231.         OK, visible, silent,
  232.         /* [4] */
  233.         OK, visible, silent
  234.     },
  235.     alertPositionMainScreen
  236. };
  237.  
  238.  
  239. resource 'DITL' (rUserAlert, purgeable) {
  240.     { /* array DITLarray: 3 elements */
  241.         /* [1] */
  242.         {80, 150, 100, 230},
  243.         Button {
  244.             enabled,
  245.             "OK"
  246.         },
  247.         /* [2] */
  248.         {10, 60, 60, 230},
  249.         StaticText {
  250.             disabled,
  251.             "Error. ^0"
  252.         },
  253.         /* [3] */
  254.         {8, 8, 40, 40},
  255.         Icon {
  256.             disabled,
  257.             2
  258.         }
  259.     }
  260. };
  261.  
  262.  
  263. resource 'WIND' (rDocWindow, preload, purgeable) {
  264.     {64, 60, 314, 460},
  265.     zoomDocProc, invisible, goAway, 0x0, "Untitled",
  266.     staggerParentWindowScreen
  267. };
  268.  
  269.  
  270. resource 'CNTL' (rVScroll, preload, purgeable) {
  271.     {-1, 385, 236, 401},
  272.     0, visible, 0, 0, scrollBarProc, 0, ""
  273. };
  274.  
  275.  
  276. resource 'CNTL' (rHScroll, preload, purgeable) {
  277.     {235, -1, 251, 386},
  278.     0, visible, 0, 0, scrollBarProc, 0, ""
  279. };
  280.  
  281. resource 'STR#' (rErrorStrings, purgeable) {
  282.     {
  283.     kApplicationName " needs at least a Macintosh 512Ke to run.";
  284.     kApplicationName " needs at least system software 6.0 to run.";
  285.     "Application memory size is too small.";
  286.     "Not enough memory to run " kApplicationName ".";
  287.     "Not enough memory to do Cut.";
  288.     "Cannot do Cut.";
  289.     "Cannot do Copy.";
  290.     "Cannot exceed 32,000 characters with Paste.";
  291.     "Not enough memory to do Paste.";
  292.     "Cannot create window.";
  293.     "Cannot exceed 32,000 characters.";
  294.     "Cannot do Paste."
  295.     }
  296. };
  297.  
  298.  
  299. resource 'SIZE' (-1) {
  300.     dontSaveScreen,
  301.     acceptSuspendResumeEvents,
  302.     enableOptionSwitch,
  303.     canBackground,                /* we can background; we don't currently, but our sleep value */
  304.                                 /* guarantees we don't hog the Mac while we are in the background */
  305.     doesActivateOnFGSwitch,        /* this says we do our own activate/deactivate; don't fake us out */
  306.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  307.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  308.     ignoreAppDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  309.     is32BitCompatible,
  310. #if qAppleEvents
  311.     isHighLevelEventAware,
  312.     localAndRemoteHLEvents,
  313. #else // qAppleEvents
  314.     notHighLevelEventAware,
  315.     reserved,
  316. #endif // qAppleEvents
  317.     notStationeryAware,
  318.     dontUseTextEditServices,
  319.     reserved,
  320.     reserved,
  321.     reserved,
  322.     128 * 1024,                    // with styled TextEdit and printing, it's rather difficult to
  323.     64 * 1024                    // define reasonable memory requirements. These are just guesses.
  324. };
  325.  
  326.  
  327. #if qPowerPC
  328. resource 'cfrg' (0) {
  329.    {
  330.       kPowerPC,
  331.       kFullLib,
  332.       kNoVersionNum, kNoVersionNum,
  333.       kDefaultStackSize, kNoAppSubFolder,
  334.       kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork,
  335.       kApplicationName
  336.    }
  337. };
  338. #endif
  339.  
  340.  
  341. type kSignature as 'STR ';
  342.  
  343.  
  344. resource kSignature (0) {
  345.     kApplicationName ": "
  346.     kApplicationBlurb ". "
  347.     "© 1989-1994 Apple Computer, Inc. All rights reserved."
  348. };
  349.  
  350.  
  351. resource 'BNDL' (128) {
  352.     kSignature,
  353.     0,
  354.     {
  355.         'ICN#',
  356.         {
  357.             0, 128
  358.         },
  359.         'FREF',
  360.         {
  361.             0, 128
  362.         }
  363.     }
  364. };
  365.  
  366.  
  367. resource 'FREF' (128) {
  368.     'APPL',
  369.     0,
  370.     ""
  371. };
  372.  
  373.  
  374. resource 'ICN#' (128, purgeable) {
  375.     {    /* array: 2 elements */
  376.         /* [1] */
  377.         $"0001 0000 0002 8000 0004 4000 0008 2000"
  378.         $"0010 101C 0021 0822 0042 0441 0084 42A1"
  379.         $"0108 8151 0211 12AA 0422 2554 0800 4AA8"
  380.         $"1088 1550 2111 2AA8 4202 5544 8444 AA82"
  381.         $"4088 9501 2110 CA02 1020 E404 0840 F808"
  382.         $"0400 0010 0200 0020 0100 0040 0080 0080"
  383.         $"0040 0100 0020 0200 0010 0400 0008 0800"
  384.         $"0004 1000 0002 2000 0001 4000 0000 80",
  385.         /* [2] */
  386.         $"0001 0000 0003 8000 0007 C000 000F E000"
  387.         $"001F F01C 003F F83E 007F FC7F 00FF FEFF"
  388.         $"01FF FFFF 03FF FFFE 07FF FFFC 0FFF FFF8"
  389.         $"1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE"
  390.         $"7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFF8"
  391.         $"07FF FFF0 03FF FFE0 01FF FFC0 00FF FF80"
  392.         $"007F FF00 003F FE00 001F FC00 000F F800"
  393.         $"0007 F000 0003 E000 0001 C000 0000 80"
  394.     }
  395. };
  396.